package com.luoluo.action;

public class ViewAction extends BaseAction {
	private static final long serialVersionUID = 1369236791239786599L;
	private static final String WWW = "/WEB-INF/www";
	private static final String VM = ".vm";
	private static final String INDEX = WWW + "/" + "index" + VM;

	public String index() throws Exception {

		String uri = this.getRequest().getRequestURI();
		System.out.println(uri);
		if (null == uri)
			getRequest().getRequestDispatcher(uri).forward(this.getRequest(),
					this.getResponse());
		if (uri.endsWith("/"))
			uri = uri.substring(0, uri.lastIndexOf("/"));
		uri = WWW + uri + VM + "?" + getRequest().getQueryString();
		getRequest().getRequestDispatcher(uri).forward(this.getRequest(),
				this.getResponse());
		return SUCCESS;
	}
}
